<?php

namespace App\Http\Controllers\Home\User;

use App\Http\Controllers\Controller;
use Carbon\Carbon;
use DeliverSchedule;
use Users;
use Tools;
use Auth;
use Notice;
use Knowledge;
use App\Models\Home\Resume as Resume;
class IndexController extends Controller
{
    public function index()
    {
        $monthBetween = Tools::getBetween();
        $historyBetween = [Carbon::parse('2000-01-01 00:00:00'),Carbon::now()->endOfMonth()];
        //1待推荐,2已推荐,3筛选通过,4安排一面,5一面fail,6安排二面,7二面fail,8面试通过,9offer中,10接offer,11拒offer,12待入职,13已入职'
        $month_data = Users::getSelfDeliverCount(Auth::user(),$monthBetween,[2,8,10,13]);
        $history_data = Users::getSelfDeliverCount(Auth::user(),$historyBetween,[2,4,6,8,10,13]);
        $user = Users::getUserRI(Auth::id());
        $schedule_list = DeliverSchedule::getResultSchedule([1=>'待推荐',2=>'已推荐',4=>'安排一面',6=>'安排二面',12=>'待入职'],Auth::user());
        $notice = Notice::getList([],0,5,['status'=>['!=','-1']]);
        $knowledge = Knowledge::getList([],0,5,['status'=>['!=','-1']],true);
        $get_resume_three = \Resume::get_resume_three();

        return view('Home.User.index',compact('user','list','month_data','history_data','schedule_list','notice','knowledge','get_resume_three'));
    }
}